<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head th:replace="header::head"></head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>求片留言-双辞动漫-专注二次元动漫的小站</title>
<meta name="keywords"
      content="双辞动漫,双辞ACG,弹幕视频,弹幕,字幕,动漫,二次元,ACG,动画,番组,新番,日本动漫,追新番,新番动漫,BGM,治愈动漫,最新动漫,动漫资源,好看的动漫,动漫网"/>
<meta name="description" content="双辞动漫专注于资源收集整理 海量的有效的高质量的动漫，资源下载，最新电影，观看完全免费、高速播放、更新及时在线，我们致力为所有动漫迷们提供最好看的动漫"/>
<script type="text/javascript">var maccms = {
    "path": "",
    "mid": "5",
    "url": "www.scdmfun.cn",
    "wapurl": "www.cdmfun.cn",
    "mob_status": "0"
};
var conchtpl = {
    "surl": "/search.html",
    "tipt": "网站公告",
    "tipc": "这里是双辞动漫新站<br><span class='hl-text-conch'>注意事项：</span>1.老站新老站账号不通用<br>老站网址：<span class='hl-text-conch'>dm.scdmfun.cn</span><br>2.如果登录后还是提示未登录请稍等一会再刷新即可<br>动漫闲聊群：<span class='hl-text-conch'>542266218</span>",
    "slink": "https://www.scdmfun.cn/",
    "short": "",
    "api": "0",
    "tok": "",
    "term": "long-term",
    "ver": "3.1"
}</script>
<body>
<div th:replace="header::.conch-header"></div>
<div id="conch-content" class="conch-content">
    <div class="conch-ctwrap">
        <div class="container">
            <div class="hl-row-box hl-rb-gbook clearfix">
                <div class="hl-comm-input">
                    <form class="hl-comm-form gbook_form gbook_font clearfix">
                        <div class="hl-comm-write hl-comm-start clearfix"><textarea
                                class="hl-comm-content gbook_content" maxlength="200"
                                placeholder="输入留言内容" v-model="ioo" @keydown="changefontnum"></textarea>
                            <div class="hl-comm-handle clearfix">
                                <div class="hl-comm-remaining hl-text-muted">还可以输入<span
                                        class="gbook_remaining">{{fontnum}}</span></div>
                                <input class="hl-comm-submit hl-bg-conch gbook_submit" type="button" @click="addmessage"
                                       value="提交留言"></div>
                        </div>
                    </form>
                </div>
                <div class="hl-rb-head clearfix"><h3 class="hl-rb-title">留言</h3><span class="hl-rb-more hl-text-muted">共&nbsp;<em
                        class="hl-text-conch" v-text="totalNum">145</em>&nbsp;条留言</span></div>
                <div class="hl-comm-list">
                    <ul class="clearfix">
                        <li class="hl-comm-each" v-for="list in commentList">
                            <div class="hl-comm-avat"><img
                                    :src="usermap[list.uid].uimage==null?'/upload/user/4/884.jpg':usermap[list.uid].uimage"/>
                            </div>
                            <div class="hl-comm-head"><span class="hl-comm-name hl-text-site">{{usermap[list.uid].nickname==null?usermap[list.uid].ucount:usermap[list.uid].nickname}}</span><span
                                    class="hl-comm-time hl-text-muted">{{list.time}}</span></div>
                            <div class="hl-comm-cont">
                                <div class="hl-comm-content hl-text-site">{{list.message}}
                                </div>
                            </div>
                        </li>
                    </ul>
                    <ul class="hl-page-wrap hl-text-center cleafix">
                        <li class="hl-hide-sm"><a @click="query(1)" class="hl-disad"><i
                                class="iconfont hl-icon-jiantoushou"></i></a></li>
                        <li><a @click="query(prePage)" :class="prePage>0?'':'hl-disad'"><span class="hl-hide-sm"><i
                                class="iconfont hl-icon-jiantouzuo"></i></span><span class="hl-hidden-xs">上一页</span></a>
                        </li>
                        <li class="hl-hidden-xs" v-if="curPage-1>2"><a
                                @click="query(totalPage)">1</a></li>
                        <li class="hl-hidden-xs hl-disad" v-if="curPage>4"><a
                                class="hl-page-dot"
                                href="javascript:;"><span>...</span></a></li>
                        <li class="hl-hidden-xs" v-if="preprePage>0"><a @click="query(preprePage)">{{preprePage}}</a>
                        </li>
                        <li class="hl-hidden-xs" v-if="prePage>0"><a @click="query(prePage)">{{prePage}}</a></li>
                        <li class="hl-hidden-xs"><a @click="query(curPage)" class="active">{{curPage}}</a></li>
                        <li class="hl-hidden-xs" v-if="nextPage>0"><a @click="query(nextPage)">{{nextPage}}</a></li>
                        <li class="hl-hidden-xs" v-if="nextnextPage>0"><a
                                @click="query(nextnextPage)">{{nextnextPage}}</a></li>
                        <li class="hl-page-tips hl-hide-sm"><a
                                href="javascript:;">{{curPage}}&nbsp;/&nbsp;{{totalPage}}</a></li>
                        <li class="hl-hidden-xs hl-disad" v-if="totalPage-curPage>3"><a
                                class="hl-page-dot"
                                href="javascript:;"><span>...</span></a></li>
                        <li class="hl-hidden-xs" v-if="totalPage-curPage>2"><a
                                @click="query(totalPage)">{{totalPage}}</a></li>
                        <li :class="nextPage>0?'':'hl-disad'"><a @click="query(nextPage)"><span class="hl-hide-sm"><i
                                class="iconfont hl-icon-jiantouyou"></i></span><span
                                class="hl-hidden-xs">下一页</span></a></li>
                        <li class="hl-hide-sm"><a @click="query(totalPage)"><i class="iconfont hl-icon-jiantouwei"></i></a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript"> var $input = $(".hl-comm-input .hl-comm-content"),
    $wrap = $(".hl-comm-input .hl-comm-write");
$input.focus(function () {
    $wrap.addClass("hl-comm-focus");
});
$input.blur(function () {
    $wrap.removeClass("hl-comm-focus");
}); </script>
<div th:replace="index::.conch-footer"></div>
<script type="text/javascript">
    let a = new Vue({
        el: "#conch-content",
        data: {
            ioo: '',
            fontnum: 200,
            user: {},
            usermap: [],
            prePage: -1,
            preprePage: -1,
            curPage: -1,
            nextPage: -1,
            nextnextPage: -1,
            totalNum: -1,
            totalPage: -1,
            commentList: []
        },
        methods: {
            addmessage() {
                this.user = login.$data.user;
                if (Object.keys(this.user).length === 0 && this.user.constructor === Object) {
                    alert("您未登录，请先登录后再进行评论");
                    return;
                }
                var url = "ioo.do";
                if (this.ioo.replace(/(^s*)|(s*$)/g, "").length == 0) {
                    alert("请输入留言内容");
                    return;
                }
                var params = new URLSearchParams();
                params.append("uid", this.user.uid);
                params.append("message", this.ioo);
                axios.post(url, params).then(res => {
                    var data = res.data;
                    alert(data.msg);
                    if (data.code == 1) {
                        this.ioo = '';
                        this.query(1);
                    }
                })
            },
            query(page) {
                var url = "queryComment.do";
                var params = new URLSearchParams();
                params.append("page", page);
                axios.post(url, params).then(res => {
                    var data = res.data;
                    this.prePage = data.data["prePage"];
                    this.preprePage = data.data["preprePage"];
                    this.curPage = data.data["curPage"];
                    this.nextPage = data.data["nextPage"];
                    this.nextnextPage = data.data["nextnextPage"];
                    this.totalNum = data.data["totalNum"];
                    this.totalPage = data.data["totalPage"];
                    this.usermap = data.data["usermap"];
                    this.commentList = data.data["dataList"];
                })
            },
            changefontnum() {
                this.fontnum = 200 - this.ioo.length;
                if (this.fontnum <= 0) {
                    alert("留言框字数已达上限");
                }
            }
        },
        beforeMount() {
            this.query(1);
        }
    });
</script>
</body>
</html>